//
//  UILabel+Extension.m
//  WeiBo
//
//  Created by 小小罗 on 15/11/25.
//  Copyright © 2015年 RealMadrid. All rights reserved.
//

#import "UILabel+Extension.h"

@implementation UILabel (Extension)
+ (UILabel *)initWithTitle:(NSString *)title fontSize:(CGFloat)fontSize color:(UIColor *)color screenInset:(CGFloat)screenInset{
    
    UILabel *label = [[UILabel alloc] init];
    label.text = title;
    label.textColor = color;
    label.font = [UIFont systemFontOfSize:fontSize];
    label.numberOfLines = 0;
    if (screenInset == 0) {
        label.textAlignment = NSTextAlignmentCenter;
    }else{
        label.preferredMaxLayoutWidth = [UIScreen mainScreen].bounds.size.width - 2 * screenInset;
        label.textAlignment = NSTextAlignmentLeft;
    }

    return label;
}

@end
